<template>
  <div class="nav-bar">
    <div class="left" @click="back()"><slot name="left"></slot></div>
    <div class="center"><slot name="center"></slot></div>
    <div class="right"><slot name="right"></slot></div>
  </div>
</template>

<script>
export default {
  name: "NavBar",
  components: {
  },
  methods: {
    back() {
      this.$router.back()
    }
  }
}
</script>

<style>
  .nav-bar{
    display:flex;
    height: 3.5rem;
    line-height: 3.5rem;
  }

  .left {
    width: 6rem;
    padding-top: 0.5rem;
    line-height: 3.5rem;
    text-align:left;
    padding-left: 0.5rem;
  }
  .right {
    width: 6rem;
    padding-top: 0.5rem;
    line-height: 3.5rem;
    text-align:right;
    padding-right: 0.5rem;
  }

  .center{
    flex: 1;
    text-align:center;
  }
</style>